<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::group(['namespace' => '\App\Module\Api\Controllers'],function(){
    Route::any('/Notify/aliPay', 'NotifyController@aliPay');
    Route::any('/Notify/wxPay', 'NotifyController@wxPay');
});

Route::group(['namespace' => '\App\Module\Api\Controllers', 'middleware' => ['cors']], function () {

    Route::group(['middleware' => ['PublicParameterVerification','sign']], function () {
    Route::any('/{module}', function ($module) {
        $class = App::make('App\\Module\\Api\\Controllers\\' . $module . 'Controller');
        return $class->index();
    });
    });

});

